package com.hnevc.xiewenguang;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Example03 {
        public static void main (String[]args) {
            try {
                FileReader reader = new FileReader("text.txt");
                FileWriter writer = new FileWriter("src\\text.txt");
                int len;
                while (true){
                    if ((len = reader.read()) !=-1){
                        System.out.println(len);
                        writer.write(len);
                    }else {
                        break;
                    }
                }
                 reader.close();
                writer.close();

            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }catch (IOException e){
                e.printStackTrace();
            }
        }
}
